#pragma once
#include <string>
#include <unordered_map>
#include <sstream>
#include <functional>
class CommandFunc
{
private:
    std::unordered_map<std::string, std::function<std::string(std::string)>> m_func;

public:
    CommandFunc();
    ~CommandFunc();

    bool DelFunc(std::string func_name);
    bool AddFunc(std::string func_name, std::function<std::string(std::string)> func);
    std::function<std::string(std::string)> &operator[](std::string func_name);

    std::string ParaseAndCall(std::string cmd);
};